<?php
/**
*
* @package shopBB
* @copyright (c) 2008 EXreaction, Lithium Studios
* @license http://opensource.org/licenses/gpl-license.php GNU Public License
*
*/

if (!defined('IN_PHPBB'))
{
	exit;
}

/**
* Common Item Posting information setup
*/
function setup_post_item()
{
	global $template, $user;

	if (!function_exists('generate_smilies'))
	{
		include(PHPBB_ROOT_PATH . 'includes/functions_posting.' . PHP_EXT);
	}
	if (!function_exists('display_custom_bbcodes'))
	{
		include(PHPBB_ROOT_PATH . 'includes/functions_display.' . PHP_EXT);
	}

	$panels = array(
		'options-panel' => 'OPTIONS',
	);

	// Add the forum key
	add_form_key('post_item');

	// Generate smiley listing
	generate_smilies('inline', false);

	// Build custom bbcodes array
	display_custom_bbcodes();

	$template->assign_vars(array(
		'S_BBCODE_ALLOWED'	=> true,
		'S_SMILIES_ALLOWED'	=> true,
		'S_BBCODE_IMG'		=> true,
		'S_LINKS_ALLOWED'	=> true,
		'S_BBCODE_FLASH'	=> true,
		//'BBCODE_STATUS'		=> '',
		//'IMG_STATUS'		=> '',
		//'FLASH_STATUS'		=> '',
		//'URL_STATUS'		=> '',
		//'SMILIES_STATUS'	=> '',
	));

	extract(shop_plugins::plugin_do('setup_post_item', compact('panels')));

	foreach ($panels as $panel_name => $panel_title)
	{
		$template->assign_block_vars('panel_list', array(
			'NAME'	=> $panel_name,
			'TITLE'	=> (isset($user->lang[$panel_title])) ? $user->lang[$panel_title] : $panel_title,
		));
	}
}

?>